#!/usr/bin/env python
# encoding: utf-8
"""
reporter.py

Created by Bud Gibson on 2010-07-27.
Copyright (c) 2010 Bud Gibson. Available under the GPL/Artistic License.
"""

from config import conf
from db_setup import db, btree
from NetworkNode import NetworkNode

def sort_displayName(x,y):
  """sort a list of profiles or profile stubs by display name"""
  return(cmp(x.displayName.lower(),y.displayName.lower()))
  
def get_sample(depth=1, btree=btree):
  """Gets a sample of all of the nodes for which I have successfully collected some data"""
  values = btree.values()
  sample = [n for n in sorted(values, sort_displayName) 
            if (n.public == True or n.public == False) and n.depth <= depth]
  return sample

def main():
  print len(get_sample(0))
  print len(get_sample(1))


if __name__ == '__main__':
  main()

